home *** CD-ROM | disk | FTP | other *** search
/ Erotic Games: Memory / Erotic Games: Memory.iso / mac / air_installers / AdobeAIR.exe / setup.swf / scripts / mx / managers / SystemManager.as < prev    next >
Text File  |  2009-02-12  |  50KB  |  1,531 lines

  1. package mx.managers
  2. {
  3.    import flash.display.DisplayObject;
  4.    import flash.display.DisplayObjectContainer;
  5.    import flash.display.Graphics;
  6.    import flash.display.InteractiveObject;
  7.    import flash.display.Loader;
  8.    import flash.display.MovieClip;
  9.    import flash.display.Sprite;
  10.    import flash.display.Stage;
  11.    import flash.display.StageAlign;
  12.    import flash.display.StageScaleMode;
  13.    import flash.events.Event;
  14.    import flash.events.IEventDispatcher;
  15.    import flash.events.MouseEvent;
  16.    import flash.events.TimerEvent;
  17.    import flash.geom.Point;
  18.    import flash.geom.Rectangle;
  19.    import flash.system.ApplicationDomain;
  20.    import flash.system.Capabilities;
  21.    import flash.text.Font;
  22.    import flash.text.TextFormat;
  23.    import flash.utils.Dictionary;
  24.    import flash.utils.Timer;
  25.    import flash.utils.getQualifiedClassName;
  26.    import mx.core.EmbeddedFontRegistry;
  27.    import mx.core.FlexSprite;
  28.    import mx.core.IChildList;
  29.    import mx.core.IFlexDisplayObject;
  30.    import mx.core.IFlexModuleFactory;
  31.    import mx.core.IInvalidating;
  32.    import mx.core.IRawChildrenContainer;
  33.    import mx.core.IUIComponent;
  34.    import mx.core.RSLItem;
  35.    import mx.core.Singleton;
  36.    import mx.core.TextFieldFactory;
  37.    import mx.core.mx_internal;
  38.    import mx.events.FlexEvent;
  39.    import mx.messaging.config.LoaderConfig;
  40.    import mx.preloaders.DownloadProgressBar;
  41.    import mx.preloaders.Preloader;
  42.    import mx.resources.IResourceManager;
  43.    import mx.resources.ResourceBundle;
  44.    import mx.resources.ResourceManager;
  45.    import mx.styles.ISimpleStyleClient;
  46.    import mx.styles.IStyleClient;
  47.    import mx.styles.StyleManager;
  48.    
  49.    use namespace mx_internal;
  50.    
  51.    public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager
  52.    {
  53.       
  54.       private static const IDLE_THRESHOLD:Number = 1000;
  55.       
  56.       mx_internal static var lastSystemManager:SystemManager;
  57.       
  58.       private static const IDLE_INTERVAL:Number = 100;
  59.       
  60.       mx_internal static var allSystemManagers:Dictionary = new Dictionary(true);
  61.       
  62.       mx_internal static const VERSION:String = "3.0.0.0";
  63.        
  64.       
  65.       mx_internal var nestLevel:int = 0;
  66.       
  67.       private var forms:Array;
  68.       
  69.       private var mouseCatcher:Sprite;
  70.       
  71.       private var _height:Number;
  72.       
  73.       private var preloader:Preloader;
  74.       
  75.       private var _document:Object;
  76.       
  77.       private var _topLevelSystemManager:ISystemManager;
  78.       
  79.       private var _toolTipIndex:int = 0;
  80.       
  81.       private var _rawChildren:SystemRawChildrenList;
  82.       
  83.       private var _explicitHeight:Number;
  84.       
  85.       private var _toolTipChildren:SystemChildrenList;
  86.       
  87.       private var form:IFocusManagerContainer;
  88.       
  89.       private var _width:Number;
  90.       
  91.       private var initialized:Boolean = false;
  92.       
  93.       private var _focusPane:Sprite;
  94.       
  95.       private var _fontList:Object = null;
  96.       
  97.       private var isStageRoot:Boolean = true;
  98.       
  99.       private var _popUpChildren:SystemChildrenList;
  100.       
  101.       private var rslSizes:Array = null;
  102.       
  103.       private var _topMostIndex:int = 0;
  104.       
  105.       private var nextFrameTimer:Timer = null;
  106.       
  107.       private var topLevel:Boolean = true;
  108.       
  109.       private var _cursorIndex:int = 0;
  110.       
  111.       mx_internal var _mouseX;
  112.       
  113.       mx_internal var _mouseY;
  114.       
  115.       private var _numModalWindows:int = 0;
  116.       
  117.       private var _screen:Rectangle;
  118.       
  119.       mx_internal var idleCounter:int = 0;
  120.       
  121.       private var _cursorChildren:SystemChildrenList;
  122.       
  123.       private var initCallbackFunctions:Array;
  124.       
  125.       private var _noTopMostIndex:int = 0;
  126.       
  127.       private var _applicationIndex:int = 1;
  128.       
  129.       private var idleTimer:Timer;
  130.       
  131.       private var doneExecutingInitCallbacks:Boolean = false;
  132.       
  133.       private var _explicitWidth:Number;
  134.       
  135.       mx_internal var topLevelWindow:IUIComponent;
  136.       
  137.       public function SystemManager()
  138.       {
  139.          initCallbackFunctions = [];
  140.          forms = [];
  141.          super();
  142.          if(stage)
  143.          {
  144.             stage.scaleMode = StageScaleMode.NO_SCALE;
  145.             stage.align = StageAlign.TOP_LEFT;
  146.          }
  147.          if(SystemManagerGlobals.topLevelSystemManagers.length > 0 && !stage)
  148.          {
  149.             topLevel = false;
  150.          }
  151.          if(!stage)
  152.          {
  153.             isStageRoot = false;
  154.          }
  155.          if(topLevel)
  156.          {
  157.             SystemManagerGlobals.topLevelSystemManagers.push(this);
  158.          }
  159.          lastSystemManager = this;
  160.          var _loc1_:Array = info()["compiledLocales"];
  161.          ResourceBundle.locale = _loc1_ != null && _loc1_.length > 0 ? _loc1_[0] : "en_US";
  162.          executeCallbacks();
  163.          stop();
  164.          if(topLevel && currentFrame != 1)
  165.          {
  166.             throw new Error("The SystemManager constructor was called when the currentFrame was at " + currentFrame + " Please add this SWF to bug 129782.");
  167.          }
  168.          if(root && root.loaderInfo)
  169.          {
  170.             root.loaderInfo.addEventListener(Event.INIT,initHandler);
  171.          }
  172.       }
  173.       
  174.       public static function getSWFRoot(param1:Object) : DisplayObject
  175.       {
  176.          var p:* = undefined;
  177.          var sm:ISystemManager = null;
  178.          var domain:ApplicationDomain = null;
  179.          var cls:Class = null;
  180.          var object:Object = param1;
  181.          var className:String = getQualifiedClassName(object);
  182.          for(p in mx_internal::allSystemManagers)
  183.          {
  184.             sm = p as ISystemManager;
  185.             domain = sm.loaderInfo.applicationDomain;
  186.             try
  187.             {
  188.                cls = Class(domain.getDefinition(className));
  189.                if(object is cls)
  190.                {
  191.                   return sm as DisplayObject;
  192.                }
  193.             }
  194.             catch(e:Error)
  195.             {
  196.                continue;
  197.             }
  198.          }
  199.          return null;
  200.       }
  201.       
  202.       mx_internal static function registerInitCallback(param1:Function) : void
  203.       {
  204.          if(!mx_internal::allSystemManagers || !mx_internal::lastSystemManager)
  205.          {
  206.             return;
  207.          }
  208.          var _loc2_:SystemManager = mx_internal::lastSystemManager;
  209.          if(_loc2_.doneExecutingInitCallbacks)
  210.          {
  211.             param1(_loc2_);
  212.          }
  213.          else
  214.          {
  215.             _loc2_.initCallbackFunctions.push(param1);
  216.          }
  217.       }
  218.       
  219.       mx_internal function addingChild(param1:DisplayObject) : void
  220.       {
  221.          var _loc4_:DisplayObjectContainer = null;
  222.          var _loc2_:int = 1;
  223.          if(!topLevel)
  224.          {
  225.             _loc4_ = parent.parent;
  226.             while(_loc4_)
  227.             {
  228.                if(_loc4_ is ILayoutManagerClient)
  229.                {
  230.                   _loc2_ = ILayoutManagerClient(_loc4_).nestLevel + 1;
  231.                   break;
  232.                }
  233.                _loc4_ = _loc4_.parent;
  234.             }
  235.          }
  236.          nestLevel = _loc2_;
  237.          if(param1 is IUIComponent)
  238.          {
  239.             IUIComponent(param1).systemManager = this;
  240.          }
  241.          var _loc3_:Class = Class(getDefinitionByName("mx.core.UIComponent"));
  242.          if(param1 is IUIComponent && !IUIComponent(param1).document)
  243.          {
  244.             IUIComponent(param1).document = document;
  245.          }
  246.          if(param1 is ILayoutManagerClient)
  247.          {
  248.             ILayoutManagerClient(param1).nestLevel = mx_internal::nestLevel + 1;
  249.          }
  250.          if(param1 is InteractiveObject)
  251.          {
  252.             if(doubleClickEnabled)
  253.             {
  254.                InteractiveObject(param1).doubleClickEnabled = true;
  255.             }
  256.          }
  257.          if(param1 is IUIComponent)
  258.          {
  259.             IUIComponent(param1).parentChanged(this);
  260.          }
  261.          if(param1 is IStyleClient)
  262.          {
  263.             IStyleClient(param1).regenerateStyleCache(true);
  264.          }
  265.          if(param1 is ISimpleStyleClient)
  266.          {
  267.             ISimpleStyleClient(param1).styleChanged(null);
  268.          }
  269.          if(param1 is IStyleClient)
  270.          {
  271.             IStyleClient(param1).notifyStyleChangeInChildren(null,true);
  272.          }
  273.          if(_loc3_ && param1 is _loc3_)
  274.          {
  275.             _loc3_(param1).initThemeColor();
  276.          }
  277.          if(_loc3_ && param1 is _loc3_)
  278.          {
  279.             _loc3_(param1).stylesInitialized();
  280.          }
  281.       }
  282.       
  283.       private function idleTimer_timerHandler(param1:TimerEvent) : void
  284.       {
  285.          ++idleCounter;
  286.          if(mx_internal::idleCounter * IDLE_INTERVAL > IDLE_THRESHOLD)
  287.          {
  288.             dispatchEvent(new FlexEvent(FlexEvent.IDLE));
  289.          }
  290.       }
  291.       
  292.       public function getExplicitOrMeasuredHeight() : Number
  293.       {
  294.          return !isNaN(explicitHeight) ? Number(explicitHeight) : Number(measuredHeight);
  295.       }
  296.       
  297.       mx_internal function notifyStyleChangeInChildren(param1:String, param2:Boolean) : void
  298.       {
  299.          var _loc6_:IStyleClient = null;
  300.          var _loc3_:Boolean = false;
  301.          var _loc4_:int = rawChildren.numChildren;
  302.          var _loc5_:int = 0;
  303.          while(_loc5_ < _loc4_)
  304.          {
  305.             if(_loc6_ = rawChildren.getChildAt(_loc5_) as IStyleClient)
  306.             {
  307.                _loc6_.styleChanged(param1);
  308.                _loc6_.notifyStyleChangeInChildren(param1,param2);
  309.             }
  310.             if(isTopLevelWindow(DisplayObject(_loc6_)))
  311.             {
  312.                _loc3_ = true;
  313.             }
  314.             _loc4_ = rawChildren.numChildren;
  315.             _loc5_++;
  316.          }
  317.          if(!_loc3_ && mx_internal::topLevelWindow is IStyleClient)
  318.          {
  319.             IStyleClient(mx_internal::topLevelWindow).styleChanged(param1);
  320.             IStyleClient(mx_internal::topLevelWindow).notifyStyleChangeInChildren(param1,param2);
  321.          }
  322.       }
  323.       
  324.       mx_internal function rawChildren_getObjectsUnderPoint(param1:Point) : Array
  325.       {
  326.          return super.getObjectsUnderPoint(param1);
  327.       }
  328.       
  329.       private function initHandler(param1:Event) : void
  330.       {
  331.          mx_internal::allSystemManagers[this] = this.loaderInfo.url;
  332.          root.loaderInfo.removeEventListener(Event.INIT,initHandler);
  333.          var _loc2_:int = totalFrames == 1 ? 0 : 1;
  334.          addFrameScript(_loc2_,mx_internal::docFrameHandler);
  335.          var _loc3_:int = _loc2_ + 1;
  336.          while(_loc3_ < totalFrames)
  337.          {
  338.             addFrameScript(_loc3_,extraFrameHandler);
  339.             _loc3_++;
  340.          }
  341.          initialize();
  342.       }
  343.       
  344.       override public function contains(param1:DisplayObject) : Boolean
  345.       {
  346.          var _loc2_:int = 0;
  347.          var _loc3_:int = 0;
  348.          var _loc4_:DisplayObject = null;
  349.          if(super.contains(param1))
  350.          {
  351.             if(param1.parent == this)
  352.             {
  353.                _loc2_ = super.getChildIndex(param1);
  354.                if(_loc2_ < mx_internal::noTopMostIndex)
  355.                {
  356.                   return true;
  357.                }
  358.             }
  359.             else
  360.             {
  361.                _loc3_ = 0;
  362.                while(_loc3_ < mx_internal::noTopMostIndex)
  363.                {
  364.                   if((_loc4_ = super.getChildAt(_loc3_)) is IRawChildrenContainer)
  365.                   {
  366.                      if(IRawChildrenContainer(_loc4_).rawChildren.contains(param1))
  367.                      {
  368.                         return true;
  369.                      }
  370.                   }
  371.                   if(_loc4_ is DisplayObjectContainer)
  372.                   {
  373.                      if(DisplayObjectContainer(_loc4_).contains(param1))
  374.                      {
  375.                         return true;
  376.                      }
  377.                   }
  378.                   _loc3_++;
  379.                }
  380.             }
  381.          }
  382.          return false;
  383.       }
  384.       
  385.       public function getDefinitionByName(param1:String) : Object
  386.       {
  387.          var _loc3_:Object = null;
  388.          var _loc2_:ApplicationDomain = !topLevel && parent is Loader ? Loader(parent).contentLoaderInfo.applicationDomain : info()["currentDomain"] as ApplicationDomain;
  389.          if(_loc2_.hasDefinition(param1))
  390.          {
  391.             _loc3_ = _loc2_.getDefinition(param1);
  392.          }
  393.          return _loc3_;
  394.       }
  395.       
  396.       public function get embeddedFontList() : Object
  397.       {
  398.          var _loc1_:Object = null;
  399.          var _loc2_:* = null;
  400.          var _loc3_:Object = null;
  401.          if(_fontList == null)
  402.          {
  403.             _fontList = {};
  404.             _loc1_ = info()["fonts"];
  405.             for(_loc2_ in _loc1_)
  406.             {
  407.                _fontList[_loc2_] = _loc1_[_loc2_];
  408.             }
  409.             if(!topLevel && _topLevelSystemManager)
  410.             {
  411.                _loc3_ = _topLevelSystemManager.embeddedFontList;
  412.                for(_loc2_ in _loc3_)
  413.                {
  414.                   _fontList[_loc2_] = _loc3_[_loc2_];
  415.                }
  416.             }
  417.          }
  418.          return _fontList;
  419.       }
  420.       
  421.       mx_internal function set cursorIndex(param1:int) : void
  422.       {
  423.          var _loc2_:int = param1 - _cursorIndex;
  424.          _cursorIndex = param1;
  425.       }
  426.       
  427.       public function set document(param1:Object) : void
  428.       {
  429.          _document = param1;
  430.       }
  431.       
  432.       override public function getChildAt(param1:int) : DisplayObject
  433.       {
  434.          return super.getChildAt(mx_internal::applicationIndex + param1);
  435.       }
  436.       
  437.       public function get rawChildren() : IChildList
  438.       {
  439.          if(!_rawChildren)
  440.          {
  441.             _rawChildren = new SystemRawChildrenList(this);
  442.          }
  443.          return _rawChildren;
  444.       }
  445.       
  446.       override public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
  447.       {
  448.          if(param1 == FlexEvent.IDLE && !idleTimer)
  449.          {
  450.             idleTimer = new Timer(IDLE_INTERVAL);
  451.             idleTimer.addEventListener(TimerEvent.TIMER,idleTimer_timerHandler);
  452.             idleTimer.start();
  453.             addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true);
  454.             addEventListener(MouseEvent.MOUSE_UP,mouseUpHandler,true);
  455.          }
  456.          super.addEventListener(param1,param2,param3,param4,param5);
  457.       }
  458.       
  459.       public function removeFocusManager(param1:IFocusManagerContainer) : void
  460.       {
  461.          var _loc2_:int = forms.length;
  462.          var _loc3_:int = 0;
  463.          while(_loc3_ < _loc2_)
  464.          {
  465.             if(forms[_loc3_] == param1)
  466.             {
  467.                if(form == param1)
  468.                {
  469.                   deactivate(param1);
  470.                }
  471.                forms.splice(_loc3_,1);
  472.                return;
  473.             }
  474.             _loc3_++;
  475.          }
  476.       }
  477.       
  478.       private function mouseMoveHandler(param1:MouseEvent) : void
  479.       {
  480.          idleCounter = 0;
  481.       }
  482.       
  483.       public function get focusPane() : Sprite
  484.       {
  485.          return _focusPane;
  486.       }
  487.       
  488.       override public function get mouseX() : Number
  489.       {
  490.          if(mx_internal::_mouseX === undefined)
  491.          {
  492.             return super.mouseX;
  493.          }
  494.          return mx_internal::_mouseX;
  495.       }
  496.       
  497.       private function mouseDownHandler(param1:MouseEvent) : void
  498.       {
  499.          var _loc2_:int = 0;
  500.          var _loc3_:DisplayObject = null;
  501.          var _loc4_:Boolean = false;
  502.          var _loc5_:int = 0;
  503.          var _loc6_:int = 0;
  504.          var _loc7_:int = 0;
  505.          var _loc8_:int = 0;
  506.          var _loc9_:IChildList = null;
  507.          idleCounter = 0;
  508.          if(numModalWindows == 0)
  509.          {
  510.             if(forms.length > 1)
  511.             {
  512.                _loc2_ = forms.length;
  513.                _loc3_ = DisplayObject(param1.target);
  514.                _loc4_ = document.rawChildren.contains(_loc3_);
  515.                while(_loc3_)
  516.                {
  517.                   _loc5_ = 0;
  518.                   while(_loc5_ < _loc2_)
  519.                   {
  520.                      if(forms[_loc5_] == _loc3_)
  521.                      {
  522.                         _loc6_ = 0;
  523.                         if(_loc3_ != form && _loc3_ is IFocusManagerContainer)
  524.                         {
  525.                            activate(IFocusManagerContainer(_loc3_));
  526.                         }
  527.                         if(popUpChildren.contains(_loc3_))
  528.                         {
  529.                            _loc9_ = popUpChildren;
  530.                         }
  531.                         else
  532.                         {
  533.                            _loc9_ = this;
  534.                         }
  535.                         _loc8_ = _loc7_ = _loc9_.getChildIndex(_loc3_);
  536.                         _loc2_ = forms.length;
  537.                         _loc6_ = 0;
  538.                         while(_loc6_ < _loc2_)
  539.                         {
  540.                            if(_loc9_.contains(forms[_loc6_]))
  541.                            {
  542.                               if(_loc9_.getChildIndex(forms[_loc6_]) > _loc7_)
  543.                               {
  544.                                  _loc8_ = Math.max(_loc9_.getChildIndex(forms[_loc6_]),_loc8_);
  545.                               }
  546.                            }
  547.                            _loc6_++;
  548.                         }
  549.                         if(_loc8_ > _loc7_ && !_loc4_)
  550.                         {
  551.                            _loc9_.setChildIndex(_loc3_,_loc8_);
  552.                         }
  553.                         return;
  554.                      }
  555.                      _loc5_++;
  556.                   }
  557.                   _loc3_ = _loc3_.parent;
  558.                }
  559.             }
  560.          }
  561.       }
  562.       
  563.       public function get screen() : Rectangle
  564.       {
  565.          if(!_screen)
  566.          {
  567.             Stage_resizeHandler();
  568.          }
  569.          return _screen;
  570.       }
  571.       
  572.       mx_internal function set topMostIndex(param1:int) : void
  573.       {
  574.          var _loc2_:int = param1 - _topMostIndex;
  575.          _topMostIndex = param1;
  576.          toolTipIndex += _loc2_;
  577.       }
  578.       
  579.       mx_internal function docFrameHandler(param1:Event = null) : void
  580.       {
  581.          var _loc2_:TextFieldFactory = null;
  582.          var _loc4_:int = 0;
  583.          var _loc5_:int = 0;
  584.          var _loc6_:Class = null;
  585.          Singleton.registerClass("mx.managers::IBrowserManager",Class(getDefinitionByName("mx.managers::BrowserManagerImpl")));
  586.          Singleton.registerClass("mx.managers::ICursorManager",Class(getDefinitionByName("mx.managers::CursorManagerImpl")));
  587.          Singleton.registerClass("mx.managers::IHistoryManager",Class(getDefinitionByName("mx.managers::HistoryManagerImpl")));
  588.          Singleton.registerClass("mx.managers::ILayoutManager",Class(getDefinitionByName("mx.managers::LayoutManager")));
  589.          Singleton.registerClass("mx.managers::IPopUpManager",Class(getDefinitionByName("mx.managers::PopUpManagerImpl")));
  590.          Singleton.registerClass("mx.managers::IToolTipManager2",Class(getDefinitionByName("mx.managers::ToolTipManagerImpl")));
  591.          if(Capabilities.playerType == "Desktop")
  592.          {
  593.             Singleton.registerClass("mx.managers::IDragManager",Class(getDefinitionByName("mx.managers::NativeDragManagerImpl")));
  594.             if(Singleton.getClass("mx.managers::IDragManager") == null)
  595.             {
  596.                Singleton.registerClass("mx.managers::IDragManager",Class(getDefinitionByName("mx.managers::DragManagerImpl")));
  597.             }
  598.          }
  599.          else
  600.          {
  601.             Singleton.registerClass("mx.managers::IDragManager",Class(getDefinitionByName("mx.managers::DragManagerImpl")));
  602.          }
  603.          Singleton.registerClass("mx.core::ITextFieldFactory",Class(getDefinitionByName("mx.core::TextFieldFactory")));
  604.          executeCallbacks();
  605.          doneExecutingInitCallbacks = true;
  606.          var _loc3_:Array = info()["mixins"];
  607.          if(_loc3_ && _loc3_.length > 0)
  608.          {
  609.             _loc4_ = _loc3_.length;
  610.             _loc5_ = 0;
  611.             while(_loc5_ < _loc4_)
  612.             {
  613.                (_loc6_ = Class(getDefinitionByName(_loc3_[_loc5_])))["init"](this);
  614.                _loc5_++;
  615.             }
  616.          }
  617.          installCompiledResourceBundles();
  618.          initializeTopLevelWindow(null);
  619.          deferredNextFrame();
  620.       }
  621.       
  622.       private function Stage_resizeHandler(param1:Event = null) : void
  623.       {
  624.          var _loc2_:Number = stage.stageWidth;
  625.          var _loc3_:Number = stage.stageHeight;
  626.          var _loc4_:Number = loaderInfo.width;
  627.          var _loc5_:Number = loaderInfo.height;
  628.          var _loc6_:Number = (_loc4_ - _loc2_) / 2;
  629.          var _loc7_:Number = (_loc5_ - _loc3_) / 2;
  630.          var _loc8_:String;
  631.          if((_loc8_ = stage.align) == StageAlign.TOP)
  632.          {
  633.             _loc7_ = 0;
  634.          }
  635.          else if(_loc8_ == StageAlign.BOTTOM)
  636.          {
  637.             _loc7_ = _loc5_ - _loc3_;
  638.          }
  639.          else if(_loc8_ == StageAlign.LEFT)
  640.          {
  641.             _loc6_ = 0;
  642.          }
  643.          else if(_loc8_ == StageAlign.RIGHT)
  644.          {
  645.             _loc6_ = _loc4_ - _loc2_;
  646.          }
  647.          else if(_loc8_ == StageAlign.TOP_LEFT || _loc8_ == "LT")
  648.          {
  649.             _loc7_ = 0;
  650.             _loc6_ = 0;
  651.          }
  652.          else if(_loc8_ == StageAlign.TOP_RIGHT)
  653.          {
  654.             _loc7_ = 0;
  655.             _loc6_ = _loc4_ - _loc2_;
  656.          }
  657.          else if(_loc8_ == StageAlign.BOTTOM_LEFT)
  658.          {
  659.             _loc7_ = _loc5_ - _loc3_;
  660.             _loc6_ = 0;
  661.          }
  662.          else if(_loc8_ == StageAlign.BOTTOM_RIGHT)
  663.          {
  664.             _loc7_ = _loc5_ - _loc3_;
  665.             _loc6_ = _loc4_ - _loc2_;
  666.          }
  667.          if(!_screen)
  668.          {
  669.             _screen = new Rectangle();
  670.          }
  671.          _screen.x = _loc6_;
  672.          _screen.y = _loc7_;
  673.          _screen.width = _loc2_;
  674.          _screen.height = _loc3_;
  675.          if(isStageRoot)
  676.          {
  677.             _width = stage.stageWidth;
  678.             _height = stage.stageHeight;
  679.          }
  680.          if(param1)
  681.          {
  682.             resizeMouseCatcher();
  683.             dispatchEvent(param1);
  684.          }
  685.       }
  686.       
  687.       public function get explicitHeight() : Number
  688.       {
  689.          return _explicitHeight;
  690.       }
  691.       
  692.       public function get preloaderBackgroundSize() : String
  693.       {
  694.          return info()["backgroundSize"];
  695.       }
  696.       
  697.       public function isTopLevel() : Boolean
  698.       {
  699.          return topLevel;
  700.       }
  701.       
  702.       override public function get mouseY() : Number
  703.       {
  704.          if(mx_internal::_mouseY === undefined)
  705.          {
  706.             return super.mouseY;
  707.          }
  708.          return mx_internal::_mouseY;
  709.       }
  710.       
  711.       public function getExplicitOrMeasuredWidth() : Number
  712.       {
  713.          return !isNaN(explicitWidth) ? Number(explicitWidth) : Number(measuredWidth);
  714.       }
  715.       
  716.       public function deactivate(param1:IFocusManagerContainer) : void
  717.       {
  718.          var _loc2_:IFocusManagerContainer = null;
  719.          var _loc3_:int = 0;
  720.          var _loc4_:int = 0;
  721.          var _loc5_:IFocusManagerContainer = null;
  722.          if(form)
  723.          {
  724.             if(form == param1 && forms.length > 1)
  725.             {
  726.                form.focusManager.deactivate();
  727.                _loc3_ = forms.length;
  728.                _loc4_ = 0;
  729.                while(_loc4_ < _loc3_)
  730.                {
  731.                   if((_loc5_ = forms[_loc4_]) == param1)
  732.                   {
  733.                      _loc4_ += 1;
  734.                      while(_loc4_ < _loc3_)
  735.                      {
  736.                         _loc5_ = forms[_loc4_];
  737.                         if(Sprite(_loc5_).visible == true && IUIComponent(_loc5_).enabled)
  738.                         {
  739.                            _loc2_ = _loc5_;
  740.                         }
  741.                         _loc4_++;
  742.                      }
  743.                      form = _loc2_;
  744.                      break;
  745.                   }
  746.                   if(Sprite(_loc5_).visible && IUIComponent(_loc5_).enabled)
  747.                   {
  748.                      _loc2_ = _loc5_;
  749.                   }
  750.                   _loc4_++;
  751.                }
  752.                if(form)
  753.                {
  754.                   form.focusManager.activate();
  755.                }
  756.             }
  757.          }
  758.       }
  759.       
  760.       override public function getChildByName(param1:String) : DisplayObject
  761.       {
  762.          return super.getChildByName(param1);
  763.       }
  764.       
  765.       override public function addChildAt(param1:DisplayObject, param2:int) : DisplayObject
  766.       {
  767.          ++noTopMostIndex;
  768.          return rawChildren_addChildAt(param1,mx_internal::applicationIndex + param2);
  769.       }
  770.       
  771.       public function get measuredWidth() : Number
  772.       {
  773.          return !!mx_internal::topLevelWindow ? Number(mx_internal::topLevelWindow.getExplicitOrMeasuredWidth()) : Number(loaderInfo.width);
  774.       }
  775.       
  776.       public function info() : Object
  777.       {
  778.          return {};
  779.       }
  780.       
  781.       mx_internal function get toolTipIndex() : int
  782.       {
  783.          return _toolTipIndex;
  784.       }
  785.       
  786.       public function setActualSize(param1:Number, param2:Number) : void
  787.       {
  788.          if(isStageRoot)
  789.          {
  790.             return;
  791.          }
  792.          _width = param1;
  793.          _height = param2;
  794.          if(mouseCatcher)
  795.          {
  796.             mouseCatcher.width = param1;
  797.             mouseCatcher.height = param2;
  798.          }
  799.          dispatchEvent(new Event(Event.RESIZE));
  800.       }
  801.       
  802.       public function set focusPane(param1:Sprite) : void
  803.       {
  804.          if(param1)
  805.          {
  806.             addChild(param1);
  807.             param1.x = 0;
  808.             param1.y = 0;
  809.             param1.scrollRect = null;
  810.             _focusPane = param1;
  811.          }
  812.          else
  813.          {
  814.             removeChild(_focusPane);
  815.             _focusPane = null;
  816.          }
  817.       }
  818.       
  819.       mx_internal function set applicationIndex(param1:int) : void
  820.       {
  821.          _applicationIndex = param1;
  822.       }
  823.       
  824.       private function executeCallbacks() : void
  825.       {
  826.          var _loc1_:Function = null;
  827.          if(!parent)
  828.          {
  829.             return;
  830.          }
  831.          while(initCallbackFunctions.length > 0)
  832.          {
  833.             _loc1_ = initCallbackFunctions.shift();
  834.             _loc1_(this);
  835.          }
  836.       }
  837.       
  838.       public function get popUpChildren() : IChildList
  839.       {
  840.          if(!topLevel)
  841.          {
  842.             return _topLevelSystemManager.popUpChildren;
  843.          }
  844.          if(!_popUpChildren)
  845.          {
  846.             _popUpChildren = new SystemChildrenList(this,new QName(mx_internal,"noTopMostIndex"),new QName(mx_internal,"topMostIndex"));
  847.          }
  848.          return _popUpChildren;
  849.       }
  850.       
  851.       public function set explicitHeight(param1:Number) : void
  852.       {
  853.          _explicitHeight = param1;
  854.       }
  855.       
  856.       override public function removeChild(param1:DisplayObject) : DisplayObject
  857.       {
  858.          --noTopMostIndex;
  859.          return rawChildren_removeChild(param1);
  860.       }
  861.       
  862.       override public function addChild(param1:DisplayObject) : DisplayObject
  863.       {
  864.          ++noTopMostIndex;
  865.          return rawChildren_addChildAt(param1,mx_internal::noTopMostIndex - 1);
  866.       }
  867.       
  868.       public function create(... rest) : Object
  869.       {
  870.          var _loc4_:String = null;
  871.          var _loc5_:int = 0;
  872.          var _loc6_:int = 0;
  873.          var _loc2_:String = info()["mainClassName"];
  874.          if(_loc2_ == null)
  875.          {
  876.             _loc5_ = (_loc4_ = loaderInfo.loaderURL).lastIndexOf(".");
  877.             _loc6_ = _loc4_.lastIndexOf("/");
  878.             _loc2_ = _loc4_.substring(_loc6_ + 1,_loc5_);
  879.          }
  880.          var _loc3_:Class = Class(getDefinitionByName(_loc2_));
  881.          return !!_loc3_ ? new _loc3_() : null;
  882.       }
  883.       
  884.       override public function get stage() : Stage
  885.       {
  886.          var _loc1_:Stage = super.stage;
  887.          if(_loc1_)
  888.          {
  889.             return _loc1_;
  890.          }
  891.          if(!topLevel && _topLevelSystemManager)
  892.          {
  893.             return _topLevelSystemManager.stage;
  894.          }
  895.          return null;
  896.       }
  897.       
  898.       mx_internal function rawChildren_removeChild(param1:DisplayObject) : DisplayObject
  899.       {
  900.          removingChild(param1);
  901.          super.removeChild(param1);
  902.          childRemoved(param1);
  903.          return param1;
  904.       }
  905.       
  906.       mx_internal final function get $numChildren() : int
  907.       {
  908.          return super.numChildren;
  909.       }
  910.       
  911.       public function get toolTipChildren() : IChildList
  912.       {
  913.          if(!topLevel)
  914.          {
  915.             return _topLevelSystemManager.toolTipChildren;
  916.          }
  917.          if(!_toolTipChildren)
  918.          {
  919.             _toolTipChildren = new SystemChildrenList(this,new QName(mx_internal,"topMostIndex"),new QName(mx_internal,"toolTipIndex"));
  920.          }
  921.          return _toolTipChildren;
  922.       }
  923.       
  924.       override public function getChildIndex(param1:DisplayObject) : int
  925.       {
  926.          return super.getChildIndex(param1) - mx_internal::applicationIndex;
  927.       }
  928.       
  929.       private function mouseUpHandler(param1:MouseEvent) : void
  930.       {
  931.          idleCounter = 0;
  932.       }
  933.       
  934.       mx_internal function rawChildren_getChildIndex(param1:DisplayObject) : int
  935.       {
  936.          return super.getChildIndex(param1);
  937.       }
  938.       
  939.       public function activate(param1:IFocusManagerContainer) : void
  940.       {
  941.          var _loc2_:IFocusManagerContainer = null;
  942.          if(form)
  943.          {
  944.             if(form != param1 && forms.length > 1)
  945.             {
  946.                _loc2_ = form;
  947.                _loc2_.focusManager.deactivate();
  948.             }
  949.          }
  950.          form = param1;
  951.          if(param1.focusManager)
  952.          {
  953.             param1.focusManager.activate();
  954.          }
  955.       }
  956.       
  957.       private function deferredNextFrame() : void
  958.       {
  959.          if(currentFrame + 1 > totalFrames)
  960.          {
  961.             return;
  962.          }
  963.          if(currentFrame + 1 <= framesLoaded)
  964.          {
  965.             nextFrame();
  966.          }
  967.          else
  968.          {
  969.             nextFrameTimer = new Timer(100);
  970.             nextFrameTimer.addEventListener(TimerEvent.TIMER,nextFrameTimerHandler);
  971.             nextFrameTimer.start();
  972.          }
  973.       }
  974.       
  975.       mx_internal function get cursorIndex() : int
  976.       {
  977.          return _cursorIndex;
  978.       }
  979.       
  980.       mx_internal function rawChildren_contains(param1:DisplayObject) : Boolean
  981.       {
  982.          return super.contains(param1);
  983.       }
  984.       
  985.       override public function setChildIndex(param1:DisplayObject, param2:int) : void
  986.       {
  987.          super.setChildIndex(param1,mx_internal::applicationIndex + param2);
  988.       }
  989.       
  990.       public function get document() : Object
  991.       {
  992.          return _document;
  993.       }
  994.       
  995.       private function resizeMouseCatcher() : void
  996.       {
  997.          var _loc1_:Graphics = null;
  998.          if(mouseCatcher)
  999.          {
  1000.             _loc1_ = mouseCatcher.graphics;
  1001.             _loc1_.clear();
  1002.             _loc1_.beginFill(0,0);
  1003.             _loc1_.drawRect(0,0,stage.stageWidth,stage.stageHeight);
  1004.             _loc1_.endFill();
  1005.          }
  1006.       }
  1007.       
  1008.       override public function get height() : Number
  1009.       {
  1010.          return _height;
  1011.       }
  1012.       
  1013.       mx_internal function rawChildren_getChildAt(param1:int) : DisplayObject
  1014.       {
  1015.          return super.getChildAt(param1);
  1016.       }
  1017.       
  1018.       mx_internal function set noTopMostIndex(param1:int) : void
  1019.       {
  1020.          var _loc2_:int = param1 - _noTopMostIndex;
  1021.          _noTopMostIndex = param1;
  1022.          topMostIndex += _loc2_;
  1023.       }
  1024.       
  1025.       override public function getObjectsUnderPoint(param1:Point) : Array
  1026.       {
  1027.          var _loc5_:DisplayObject = null;
  1028.          var _loc6_:Array = null;
  1029.          var _loc2_:Array = [];
  1030.          var _loc3_:int = mx_internal::topMostIndex;
  1031.          var _loc4_:int = 0;
  1032.          while(_loc4_ < _loc3_)
  1033.          {
  1034.             if((_loc5_ = super.getChildAt(_loc4_)) is DisplayObjectContainer)
  1035.             {
  1036.                if(_loc6_ = DisplayObjectContainer(_loc5_).getObjectsUnderPoint(param1))
  1037.                {
  1038.                   _loc2_ = _loc2_.concat(_loc6_);
  1039.                }
  1040.             }
  1041.             _loc4_++;
  1042.          }
  1043.          return _loc2_;
  1044.       }
  1045.       
  1046.       mx_internal function get topMostIndex() : int
  1047.       {
  1048.          return _topMostIndex;
  1049.       }
  1050.       
  1051.       mx_internal function regenerateStyleCache(param1:Boolean) : void
  1052.       {
  1053.          var _loc5_:IStyleClient = null;
  1054.          var _loc2_:Boolean = false;
  1055.          var _loc3_:int = rawChildren.numChildren;
  1056.          var _loc4_:int = 0;
  1057.          while(_loc4_ < _loc3_)
  1058.          {
  1059.             if(_loc5_ = rawChildren.getChildAt(_loc4_) as IStyleClient)
  1060.             {
  1061.                _loc5_.regenerateStyleCache(param1);
  1062.             }
  1063.             if(isTopLevelWindow(DisplayObject(_loc5_)))
  1064.             {
  1065.                _loc2_ = true;
  1066.             }
  1067.             _loc3_ = rawChildren.numChildren;
  1068.             _loc4_++;
  1069.          }
  1070.          if(!_loc2_ && mx_internal::topLevelWindow is IStyleClient)
  1071.          {
  1072.             IStyleClient(mx_internal::topLevelWindow).regenerateStyleCache(param1);
  1073.          }
  1074.       }
  1075.       
  1076.       public function addFocusManager(param1:IFocusManagerContainer) : void
  1077.       {
  1078.          forms.push(param1);
  1079.       }
  1080.       
  1081.       public function isFontFaceEmbedded(param1:TextFormat) : Boolean
  1082.       {
  1083.          var _loc6_:Font = null;
  1084.          var _loc7_:String = null;
  1085.          var _loc2_:String = param1.font;
  1086.          var _loc3_:Array = Font.enumerateFonts();
  1087.          var _loc4_:int = 0;
  1088.          while(_loc4_ < _loc3_.length)
  1089.          {
  1090.             if((_loc6_ = Font(_loc3_[_loc4_])).fontName == _loc2_)
  1091.             {
  1092.                _loc7_ = "regular";
  1093.                if(param1.bold && param1.italic)
  1094.                {
  1095.                   _loc7_ = "boldItalic";
  1096.                }
  1097.                else if(param1.bold)
  1098.                {
  1099.                   _loc7_ = "bold";
  1100.                }
  1101.                else if(param1.italic)
  1102.                {
  1103.                   _loc7_ = "italic";
  1104.                }
  1105.                if(_loc6_.fontStyle == _loc7_)
  1106.                {
  1107.                   return true;
  1108.                }
  1109.             }
  1110.             _loc4_++;
  1111.          }
  1112.          if(!_loc2_ || !embeddedFontList || !embeddedFontList[_loc2_])
  1113.          {
  1114.             return false;
  1115.          }
  1116.          var _loc5_:Object = embeddedFontList[_loc2_];
  1117.          return !(param1.bold && !_loc5_.bold || param1.italic && !_loc5_.italic || !param1.bold && !param1.italic && !_loc5_.regular);
  1118.       }
  1119.       
  1120.       mx_internal function rawChildren_setChildIndex(param1:DisplayObject, param2:int) : void
  1121.       {
  1122.          super.setChildIndex(param1,param2);
  1123.       }
  1124.       
  1125.       mx_internal function childAdded(param1:DisplayObject) : void
  1126.       {
  1127.          param1.dispatchEvent(new FlexEvent(FlexEvent.ADD));
  1128.          if(param1 is IUIComponent)
  1129.          {
  1130.             IUIComponent(param1).initialize();
  1131.          }
  1132.       }
  1133.       
  1134.       override public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
  1135.       {
  1136.          if(param1 == FlexEvent.IDLE)
  1137.          {
  1138.             super.removeEventListener(param1,param2,param3);
  1139.             if(!hasEventListener(FlexEvent.IDLE) && idleTimer)
  1140.             {
  1141.                idleTimer.stop();
  1142.                idleTimer = null;
  1143.                removeEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
  1144.                removeEventListener(MouseEvent.MOUSE_UP,mouseUpHandler);
  1145.             }
  1146.          }
  1147.          else
  1148.          {
  1149.             super.removeEventListener(param1,param2,param3);
  1150.          }
  1151.       }
  1152.       
  1153.       private function extraFrameHandler(param1:Event = null) : void
  1154.       {
  1155.          var _loc3_:Class = null;
  1156.          var _loc2_:Object = info()["frames"];
  1157.          if(_loc2_ && _loc2_[currentLabel])
  1158.          {
  1159.             _loc3_ = Class(getDefinitionByName(_loc2_[currentLabel]));
  1160.             _loc3_["frame"](this);
  1161.          }
  1162.          deferredNextFrame();
  1163.       }
  1164.       
  1165.       public function get application() : IUIComponent
  1166.       {
  1167.          return IUIComponent(_document);
  1168.       }
  1169.       
  1170.       override public function removeChildAt(param1:int) : DisplayObject
  1171.       {
  1172.          --noTopMostIndex;
  1173.          return rawChildren_removeChildAt(mx_internal::applicationIndex + param1);
  1174.       }
  1175.       
  1176.       mx_internal function rawChildren_removeChildAt(param1:int) : DisplayObject
  1177.       {
  1178.          var _loc2_:DisplayObject = super.getChildAt(param1);
  1179.          removingChild(_loc2_);
  1180.          super.removeChildAt(param1);
  1181.          childRemoved(_loc2_);
  1182.          return _loc2_;
  1183.       }
  1184.       
  1185.       private function installCompiledResourceBundles() : void
  1186.       {
  1187.          var _loc1_:Object = this.info();
  1188.          var _loc2_:ApplicationDomain = !topLevel && parent is Loader ? Loader(parent).contentLoaderInfo.applicationDomain : _loc1_["currentDomain"];
  1189.          var _loc3_:Array = _loc1_["compiledLocales"];
  1190.          var _loc4_:Array = _loc1_["compiledResourceBundleNames"];
  1191.          var _loc5_:IResourceManager;
  1192.          (_loc5_ = ResourceManager.getInstance()).installCompiledResourceBundles(_loc2_,_loc3_,_loc4_);
  1193.          if(!_loc5_.localeChain)
  1194.          {
  1195.             _loc5_.initializeLocaleChain(_loc3_);
  1196.          }
  1197.       }
  1198.       
  1199.       mx_internal function removingChild(param1:DisplayObject) : void
  1200.       {
  1201.          param1.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
  1202.       }
  1203.       
  1204.       mx_internal function get applicationIndex() : int
  1205.       {
  1206.          return _applicationIndex;
  1207.       }
  1208.       
  1209.       mx_internal function set toolTipIndex(param1:int) : void
  1210.       {
  1211.          var _loc2_:int = param1 - _toolTipIndex;
  1212.          _toolTipIndex = param1;
  1213.          cursorIndex += _loc2_;
  1214.       }
  1215.       
  1216.       public function get cursorChildren() : IChildList
  1217.       {
  1218.          if(!topLevel)
  1219.          {
  1220.             return _topLevelSystemManager.cursorChildren;
  1221.          }
  1222.          if(!_cursorChildren)
  1223.          {
  1224.             _cursorChildren = new SystemChildrenList(this,new QName(mx_internal,"toolTipIndex"),new QName(mx_internal,"cursorIndex"));
  1225.          }
  1226.          return _cursorChildren;
  1227.       }
  1228.       
  1229.       public function get preloaderBackgroundImage() : Object
  1230.       {
  1231.          return info()["backgroundImage"];
  1232.       }
  1233.       
  1234.       public function set numModalWindows(param1:int) : void
  1235.       {
  1236.          _numModalWindows = param1;
  1237.       }
  1238.       
  1239.       public function get preloaderBackgroundAlpha() : Number
  1240.       {
  1241.          return info()["backgroundAlpha"];
  1242.       }
  1243.       
  1244.       mx_internal function rawChildren_getChildByName(param1:String) : DisplayObject
  1245.       {
  1246.          return super.getChildByName(param1);
  1247.       }
  1248.       
  1249.       private function preloader_preloaderDoneHandler(param1:Event) : void
  1250.       {
  1251.          var _loc2_:IUIComponent = mx_internal::topLevelWindow;
  1252.          preloader.removeEventListener(FlexEvent.PRELOADER_DONE,preloader_preloaderDoneHandler);
  1253.          _popUpChildren.removeChild(preloader);
  1254.          preloader = null;
  1255.          mouseCatcher = new FlexSprite();
  1256.          mouseCatcher.name = "mouseCatcher";
  1257.          ++noTopMostIndex;
  1258.          super.addChildAt(mouseCatcher,0);
  1259.          resizeMouseCatcher();
  1260.          if(!topLevel)
  1261.          {
  1262.             mouseCatcher.visible = false;
  1263.             mask = mouseCatcher;
  1264.          }
  1265.          ++noTopMostIndex;
  1266.          super.addChildAt(DisplayObject(_loc2_),1);
  1267.          _loc2_.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
  1268.          dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
  1269.       }
  1270.       
  1271.       public function get preloaderBackgroundColor() : uint
  1272.       {
  1273.          var _loc1_:* = info()["backgroundColor"];
  1274.          if(_loc1_ == undefined)
  1275.          {
  1276.             return StyleManager.NOT_A_COLOR;
  1277.          }
  1278.          return StyleManager.getColorName(_loc1_);
  1279.       }
  1280.       
  1281.       public function get topLevelSystemManager() : ISystemManager
  1282.       {
  1283.          if(topLevel)
  1284.          {
  1285.             return this;
  1286.          }
  1287.          return _topLevelSystemManager;
  1288.       }
  1289.       
  1290.       mx_internal function initialize() : void
  1291.       {
  1292.          var _loc6_:int = 0;
  1293.          var _loc7_:int = 0;
  1294.          var _loc9_:EmbeddedFontRegistry = null;
  1295.          var _loc13_:Class = null;
  1296.          var _loc14_:Object = null;
  1297.          var _loc15_:RSLItem = null;
  1298.          if(isStageRoot)
  1299.          {
  1300.             _width = stage.stageWidth;
  1301.             _height = stage.stageHeight;
  1302.          }
  1303.          else
  1304.          {
  1305.             _width = loaderInfo.width;
  1306.             _height = loaderInfo.height;
  1307.          }
  1308.          preloader = new Preloader();
  1309.          preloader.addEventListener(FlexEvent.INIT_PROGRESS,preloader_initProgressHandler);
  1310.          preloader.addEventListener(FlexEvent.PRELOADER_DONE,preloader_preloaderDoneHandler);
  1311.          if(!_popUpChildren)
  1312.          {
  1313.             _popUpChildren = new SystemChildrenList(this,new QName(mx_internal,"noTopMostIndex"),new QName(mx_internal,"topMostIndex"));
  1314.          }
  1315.          _popUpChildren.addChild(preloader);
  1316.          var _loc1_:Array = info()["rsls"];
  1317.          var _loc2_:Array = info()["cdRsls"];
  1318.          var _loc3_:Boolean = true;
  1319.          if(info()["usePreloader"] != undefined)
  1320.          {
  1321.             _loc3_ = info()["usePreloader"];
  1322.          }
  1323.          var _loc4_:Class = info()["preloader"] as Class;
  1324.          if(_loc3_ && !_loc4_)
  1325.          {
  1326.             _loc4_ = DownloadProgressBar;
  1327.          }
  1328.          var _loc5_:Array = [];
  1329.          if(_loc2_ && _loc2_.length > 0)
  1330.          {
  1331.             _loc13_ = Class(getDefinitionByName("mx.core::CrossDomainRSLItem"));
  1332.             _loc6_ = _loc2_.length;
  1333.             _loc7_ = 0;
  1334.             while(_loc7_ < _loc6_)
  1335.             {
  1336.                _loc14_ = new _loc13_(_loc2_[_loc7_]["rsls"],_loc2_[_loc7_]["policyFiles"],_loc2_[_loc7_]["digests"],_loc2_[_loc7_]["types"],_loc2_[_loc7_]["isSigned"]);
  1337.                _loc5_.push(_loc14_);
  1338.                _loc7_++;
  1339.             }
  1340.          }
  1341.          if(_loc1_ != null && _loc1_.length > 0)
  1342.          {
  1343.             _loc6_ = _loc1_.length;
  1344.             _loc7_ = 0;
  1345.             while(_loc7_ < _loc6_)
  1346.             {
  1347.                _loc15_ = new RSLItem(_loc1_[_loc7_].url);
  1348.                _loc5_.push(_loc15_);
  1349.                _loc7_++;
  1350.             }
  1351.          }
  1352.          Singleton.registerClass("mx.resources::IResourceManager",Class(getDefinitionByName("mx.resources::ResourceManagerImpl")));
  1353.          var _loc8_:IResourceManager = ResourceManager.getInstance();
  1354.          Singleton.registerClass("mx.core::IEmbeddedFontRegistry",Class(getDefinitionByName("mx.core::EmbeddedFontRegistry")));
  1355.          Singleton.registerClass("mx.styles::IStyleManager",Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
  1356.          Singleton.registerClass("mx.styles::IStyleManager2",Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
  1357.          var _loc10_:String;
  1358.          if((_loc10_ = loaderInfo.parameters["localeChain"]) != null && _loc10_ != "")
  1359.          {
  1360.             _loc8_.localeChain = _loc10_.split(",");
  1361.          }
  1362.          var _loc11_:String;
  1363.          var _loc12_:Array = !!(_loc11_ = loaderInfo.parameters["resourceModuleURLs"]) ? _loc11_.split(",") : null;
  1364.          preloader.initialize(_loc3_,_loc4_,preloaderBackgroundColor,preloaderBackgroundAlpha,preloaderBackgroundImage,preloaderBackgroundSize,!!isStageRoot ? Number(stage.stageWidth) : Number(loaderInfo.width),!!isStageRoot ? Number(stage.stageHeight) : Number(loaderInfo.height),null,null,_loc5_,_loc12_);
  1365.       }
  1366.       
  1367.       private function appCreationCompleteHandler(param1:FlexEvent) : void
  1368.       {
  1369.          var _loc2_:DisplayObjectContainer = null;
  1370.          if(!topLevel && parent)
  1371.          {
  1372.             _loc2_ = parent.parent;
  1373.             while(_loc2_)
  1374.             {
  1375.                if(_loc2_ is IInvalidating)
  1376.                {
  1377.                   IInvalidating(_loc2_).invalidateSize();
  1378.                   IInvalidating(_loc2_).invalidateDisplayList();
  1379.                   return;
  1380.                }
  1381.                _loc2_ = _loc2_.parent;
  1382.             }
  1383.          }
  1384.       }
  1385.       
  1386.       public function get measuredHeight() : Number
  1387.       {
  1388.          return !!mx_internal::topLevelWindow ? Number(mx_internal::topLevelWindow.getExplicitOrMeasuredHeight()) : Number(loaderInfo.height);
  1389.       }
  1390.       
  1391.       mx_internal function rawChildren_addChildAt(param1:DisplayObject, param2:int) : DisplayObject
  1392.       {
  1393.          addingChild(param1);
  1394.          super.addChildAt(param1,param2);
  1395.          childAdded(param1);
  1396.          return param1;
  1397.       }
  1398.       
  1399.       private function nextFrameTimerHandler(param1:TimerEvent) : void
  1400.       {
  1401.          if(currentFrame + 1 <= framesLoaded)
  1402.          {
  1403.             nextFrame();
  1404.             nextFrameTimer.removeEventListener(TimerEvent.TIMER,nextFrameTimerHandler);
  1405.             nextFrameTimer.reset();
  1406.          }
  1407.       }
  1408.       
  1409.       mx_internal function childRemoved(param1:DisplayObject) : void
  1410.       {
  1411.          if(param1 is IUIComponent)
  1412.          {
  1413.             IUIComponent(param1).parentChanged(null);
  1414.          }
  1415.       }
  1416.       
  1417.       mx_internal function get noTopMostIndex() : int
  1418.       {
  1419.          return _noTopMostIndex;
  1420.       }
  1421.       
  1422.       override public function get numChildren() : int
  1423.       {
  1424.          return mx_internal::noTopMostIndex - mx_internal::applicationIndex;
  1425.       }
  1426.       
  1427.       private function initializeTopLevelWindow(param1:Event) : void
  1428.       {
  1429.          var _loc2_:IUIComponent = null;
  1430.          var _loc3_:DisplayObjectContainer = null;
  1431.          initialized = true;
  1432.          if(!parent)
  1433.          {
  1434.             return;
  1435.          }
  1436.          if(!topLevel)
  1437.          {
  1438.             _loc3_ = parent.parent;
  1439.             if(!_loc3_)
  1440.             {
  1441.                return;
  1442.             }
  1443.             while(_loc3_)
  1444.             {
  1445.                if(_loc3_ is IUIComponent)
  1446.                {
  1447.                   _topLevelSystemManager = IUIComponent(_loc3_).systemManager;
  1448.                   break;
  1449.                }
  1450.                _loc3_ = _loc3_.parent;
  1451.             }
  1452.          }
  1453.          addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler,true);
  1454.          if(topLevel && stage)
  1455.          {
  1456.             stage.addEventListener(Event.RESIZE,Stage_resizeHandler,false,0,true);
  1457.          }
  1458.          document = _loc2_ = topLevelWindow = IUIComponent(create());
  1459.          if(document)
  1460.          {
  1461.             IEventDispatcher(_loc2_).addEventListener(FlexEvent.CREATION_COMPLETE,appCreationCompleteHandler);
  1462.             if(topLevel && stage)
  1463.             {
  1464.                LoaderConfig._url = loaderInfo.url;
  1465.                LoaderConfig._parameters = loaderInfo.parameters;
  1466.                _width = stage.stageWidth;
  1467.                _height = stage.stageHeight;
  1468.                IFlexDisplayObject(_loc2_).setActualSize(stage.stageWidth,stage.stageHeight);
  1469.             }
  1470.             else
  1471.             {
  1472.                IFlexDisplayObject(_loc2_).setActualSize(loaderInfo.width,loaderInfo.height);
  1473.             }
  1474.             if(preloader)
  1475.             {
  1476.                preloader.registerApplication(_loc2_);
  1477.             }
  1478.             addingChild(DisplayObject(_loc2_));
  1479.             childAdded(DisplayObject(_loc2_));
  1480.          }
  1481.          else
  1482.          {
  1483.             document = this;
  1484.          }
  1485.       }
  1486.       
  1487.       public function get numModalWindows() : int
  1488.       {
  1489.          return _numModalWindows;
  1490.       }
  1491.       
  1492.       public function isTopLevelWindow(param1:DisplayObject) : Boolean
  1493.       {
  1494.          return param1 is IUIComponent && IUIComponent(param1) == mx_internal::topLevelWindow;
  1495.       }
  1496.       
  1497.       override public function get width() : Number
  1498.       {
  1499.          return _width;
  1500.       }
  1501.       
  1502.       public function move(param1:Number, param2:Number) : void
  1503.       {
  1504.       }
  1505.       
  1506.       public function set explicitWidth(param1:Number) : void
  1507.       {
  1508.          _explicitWidth = param1;
  1509.       }
  1510.       
  1511.       private function preloader_initProgressHandler(param1:Event) : void
  1512.       {
  1513.          preloader.removeEventListener(FlexEvent.INIT_PROGRESS,preloader_initProgressHandler);
  1514.          deferredNextFrame();
  1515.       }
  1516.       
  1517.       public function get explicitWidth() : Number
  1518.       {
  1519.          return _explicitWidth;
  1520.       }
  1521.       
  1522.       mx_internal function rawChildren_addChild(param1:DisplayObject) : DisplayObject
  1523.       {
  1524.          addingChild(param1);
  1525.          super.addChild(param1);
  1526.          childAdded(param1);
  1527.          return param1;
  1528.       }
  1529.    }
  1530. }
  1531.